use Test::More 'no_plan';

use lib "../lib/cpp", "../lib/ioc", "../lib/toolkit", '../lib/message';

use TinyMessage;
use CHeaderParser;
use Set;

my $checks = {
	0 => sub { my($class) = @_; is($class, 'A'); },
	1 => sub { my($class) = @_; is($class, 'A1'); },
	2 => sub { my($class) = @_; is($class, 'B'); },
	3 => sub { my($class) = @_; is($class, 'one::C'); },
	4 => sub { my($class) = @_; is($class, 'two::three::C'); },
	5 => sub { my($class) = @_; is($class, 'D'); },
	6 => sub { my($class) = @_; is($class, 'E'); },
	7 => sub { my($class) = @_; is($class, 'Z'); },
}; 

my $counter = 0;

my $classes = new Set();

CHeaderParser::parse(\*DATA, {
	class => sub {
		my $context = shift;
		my $class = $context->classContext();
		 
		$classes->put($class);
		
		&{ $checks->{$counter} } ($class->name());
		
		$counter++; 
	} 
});


my @classes = $classes->values();
is(@classes, 7, 'class count');

__DATA__
/*
 * ConsoleLogModule.h
 *
 *  Created on: 21.11.2011
 *      Author: caiiiycuk
 */

#ifndef CONSOLELOGMODULE_H_
#define CONSOLELOGMODULE_H_

#include "../services/LogService.h"
#include "../services/ConsoleLogService.h"
#include "../../ioc/headers/ioc.h"

#include "ConsoleLogServiceProvider.h"

class FORWARD;

class A {}

class 
A1
{
	friend class FORWARD2;
}

class B: public A {}

namespace one {
class C: public A, public B {}
} 

namespace two { namespace three {
class C: public A, 
	public B {}
} }
	
class D: A, public B {}

class E: public D {
	class Z {
		
	}
}

#endif /* CONSOLELOGMODULE_H_ */